package com.crp.security;

import org.apache.shiro.authc.AuthenticationToken;

import java.util.Map;

/**
 * @author maxmin
 *
 * @date 2015年11月9日 上午11:02:19
 */
@SuppressWarnings("serial")
public class StatelessToken implements AuthenticationToken {

    private String key;
    private Map<String, ?> params;
    private String digest;


    /**
     * @param key
     * @param params
     * @param digest
     */
    public StatelessToken(String key, Map<String, ?> params, String digest) {
        this.key = key;
        this.params = params;
        this.digest = digest;
    }


    @Override
    public Object getPrincipal() {
        return key;
    }

    @Override
    public Object getCredentials() {
        return digest;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public Map<String, ?> getParams() {
        return params;
    }

    public void setParams(Map<String, ?> params) {
        this.params = params;
    }

    public String getDigest() {
        return digest;
    }

    public void setDigest(String digest) {
        this.digest = digest;
    }
}
